package com.memory.spring_0829.model.entity;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.memory.spring_0829.utils.GenderConverter;
import com.memory.spring_0829.utils.UserNoConverter;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
// @ExcelIgnoreUnannotated
public class User {

    @ExcelProperty(index = 0)
    private Long id;
    @ExcelProperty(index = 1, converter = UserNoConverter.class)
    private String userNo;
    @ExcelProperty(index = 3, converter = GenderConverter.class)
//    @ExcelProperty("性别")
    private Integer gender;
    @ExcelProperty(index = 2)
//    @ExcelProperty("姓名")
    private String name;
    @ExcelProperty(index = 4)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")

    private Date birthday;
    @ExcelProperty(index = 5)
    private String phone;
    @ExcelProperty(index = 6)
    private String email;
    @ExcelIgnore
    private Integer isDelete;
    @ExcelProperty(index = 7)
    private String address;
}